from server.module_chat.chat.core.agent.tool.api.act_chat_api import ActChatApi
from server.module_chat.chat.core.agent.tool.api.chat_api import ChatApi
from server.module_chat.chat.core.agent.tool.api.dify_chat_api import DifyChatApi
from server.module_chat.chat.core.agent.tool.tool import ToolApi


class ChatApiFactory:
    def create(self, tool_api: ToolApi) -> ChatApi:
        api_mode = tool_api.api_mode
        if api_mode == "GPT":
            return ActChatApi(tool_api)
        elif api_mode == "Act":
            return ActChatApi(tool_api)
        elif api_mode == "Dify":
            return DifyChatApi(tool_api)

